const path = require('path');
const CopyPlugin = require('copy-webpack-plugin');

const copyPatterns = ['assets', 'worker'].map((dir) => {
  return {
    from: path.resolve(__dirname, `./node_modules/@paodingai/pdflux-pdf-viewer/dist/${dir}`),
    to: `pdflux-pdf-viewer/${dir}`,
  };
});

/**
 * @type {import('@vue/cli-service').ProjectOptions}
 */
module.exports = {
  configureWebpack: {
    plugins: [new CopyPlugin(copyPatterns)],
  },
  devServer: {},
};
